<template>
  <section>
    <header>
      <div class="user">{{data.created_by.username}}</div>
      <div>
        <span>{{GLOBAL.timestampToTime(data.created_at)}}</span>
        <span class="sure_comm" @click="commComm">评论</span>
      </div>
    </header>
    <div>
      <p>{{data.content}}</p>
    </div>
  </section>
</template>
<script>
export default {
  props:['data','change'],
  data(){
    return{

    }
  },
  methods:{
    commComm(){
      this.GLOBAL.tokenRequest({
        method:'post',
        baseURL:this.GLOBAL.API_RNTY_URL,
        url:'ftcomments/publish',
        data:{
          content:this.commComm,
          pid:this.id.id,//评论帖子|回复的id
          tid:this.id.tid,//板块id
        }
      }).then(({data:data})=>{
        this.$router.go(0)
      })
    }
  }
}
</script>
<style scoped>
section{
  margin-top:15px;
  padding-left:60px; 
  min-height:60px;
  border-bottom: 1px solid #dedede;
}
header{
  width:790px;
  font: 14px/22px '微软雅黑';
  margin-bottom: 1px;
  display: flex;
  padding:0 5px;
  justify-content: space-between;
}
p{
  padding: 0 20px;
  font:14px/20px '微软雅黑'
}
.user{
  color:#2965b1;
}
.user:hover{
  text-decoration: underline;
  cursor: pointer;
}
.sure_comm{
  cursor: pointer;
}
</style>

